<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<LCA.Community.Web.Models.ISocialNetworkElement>" %>
<%@ Import Namespace="LCA.Community.DAL.Model" %>
<%@ Import Namespace="Microsoft.Web.Mvc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
    <script src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" type="text/javascript"></script>
    <script src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>" type="text/javascript"></script>
    <script type="text/javascript">
        function beginAnimation() {
            $('#loading').show();
        }

        function completeAnimation() {
            $('#loading').hide();
        }
    </script>      
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-main">
        <h2><img src="<%= Url.Content("~/Content/images/FinalDesign/Icons/mail24.png") %>" />Mis mensajes</h2>
        <div class="mailbox">
            <% using (Ajax.BeginForm("Remove", "Mailbox", new { id = Model.ID }, new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "messages", OnBegin = "beginAnimation", OnComplete = "completeAnimation"}))
               { %>
                <div class="mailbox-header">
                    <a href="<%= Url.Action("Create","Mailbox",new { id=Model.ID}) %>"><img src="<%= Url.Content("~/Content/images/FinalDesign/Icons/mail_add32.png") %>" style="display:inline;vertical-align:top;" alt="Nuevo mensaje" /></a>
                    <%= Html.SubmitImage("Submit", Url.Content("~/Content/images/FinalDesign/Icons/mail_remove32.png"), new { style="display:inline;",alt = "Borrar mensajes" })%>
                    <img width="24px" id="loading" src="<%= Url.Content("~/Content/images/LCA_logo_rotor.gif") %>" alt="Cargando..." style="display:none;" />
                </div>
                <div id="messages">
                <% Html.RenderPartial("ShowMessages",Model.Messages); %>
                </div>
            <%} %>
        </div>
    </div>
    <div class="content-right">
        <% if ((bool)ViewData["isuser"])
           {
               Html.RenderPartial("UserMenu", Model.Element);
           }
           else
           {
               Html.RenderPartial("GroupMenu", Model.Element);
           } %>
    </div>
</asp:Content>


